package com.shiny.kittyfat.activity.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import com.shiny.kittyfat.R;

import java.io.File;

public abstract class BaseActivity extends AppCompatActivity {
    /**
     * Ui
     * */
    protected String TAG;
    private View mViews = null;


    /**
     * Abstract function
     * */
    protected abstract int getLayoutId();
    protected abstract void initViews();
    protected abstract void initData();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initBaseView();
       // createActivity();
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d(TAG,"onStart function start");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d(TAG,"onResume function start");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d(TAG,"onPause function start");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d(TAG,"onStop function start");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d(TAG,"onDestroy function start");
    }

    private void initBaseView(){
        TAG = getComponentName().getShortClassName();
    }

    private final synchronized void createActivity(){
        /*LayoutInflater inflater = LayoutInflater.from(this);
        mViews = inflater.inflate(getLayoutId(),null);
        setContentView(mViews);
        initViews();
        initData();*/
    }
}
